
#ifndef STRING_H
#define STRING_H

typedef struct {
	int size; /* buffer size */
	int offset; /* current length */
	char *buf;
}buffer_t;

extern buffer_t *buffer_init(const char *str, const int size);
extern buffer_t *buffer_limit_init(const int size);
extern void buffer_clean(buffer_t *s);
extern void buffer_append(buffer_t *s, const char *str, const int size);
extern void buffer_append_r(buffer_t *s, buffer_t *m);
extern void buffer_reset(buffer_t *s);
extern void buffer_grow(buffer_t *s, const int len);
extern char * trim(char *s);
#endif
